package com.tdd.api.server.base.enums;

/**
 * @author TDD
 * @version V1.0.0
 * @description: ${Description}
 * @date 2020/3/12 11:58
 * @copyright Copyright © 2019 
 */
public enum UseTypeEnum {


    USE_TYPE_WASH(1,"洗車"),
    USE_TYPE_GIVE(2,"贈送"),
    USE_TYPE_MINUS(3,"管理員扣除"),

    ;

    private Integer code;
    private String desc;

    UseTypeEnum(Integer code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public Integer getCode(){
        return this.code;
    }
    public String getDesc(){
        return this.desc;
    }

    public static UseTypeEnum getInstance(Integer code){
        for (UseTypeEnum e : UseTypeEnum.values()){
            if (e.getCode().equals(code)){
                return e;
            }
        }
        return null;
    }
}
